class HandleSearch {
    parseQueryString(url){
        var reg = /\?([^\?#]*)#?/;
        var queryString = reg.exec(url) && reg.exec(url)[1];
        if(queryString){
            var keyValues = queryString.split('&');
            var queryJson = {};
            for(var index in keyValues){
                var key = keyValues[index].split('=')[0];
                var value = keyValues[index].split('=')[1];
                queryJson[key] = value;
            }
            return queryJson;
        }
    }
}

export default new HandleSearch();